package com.thx.resource;

import java.util.ArrayList;
import java.util.List;

import com.thx.common.spring.BeanFactory;
import com.thx.privilege.PriviHandle;
import com.thx.privilege.PriviObj;
import com.thx.resource.model.Resource;
import com.thx.resource.service.ResourceManager;

public class PriviHandleImpl implements PriviHandle{

	@Override
	public List<PriviObj> getPriviObjects() {
		ResourceManager resMgr=(ResourceManager) BeanFactory.getBean("resourceManager"); 
		List<Resource> res =resMgr.getTree();
		List<PriviObj> po = new ArrayList<PriviObj>();
		if(res!=null&&res.size()>0){
			for(Resource r : res){
				po.add(r);
			}
		}
		return po;
	}
	
}
